package com.ruoyi.huanjing.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 目录结构节点类
 */
@Data
@NoArgsConstructor
public class DirItem {
    private String name;
    private List<DirItem> children;
    // 新增附加信息字段
    private Integer number;       // 条目数
    private String memorySize;   // 内存大小
    private Boolean measured;     // 是否实测（"true"或null）
    private Integer totalDada;  //数据总量
    private String fileType;            // 文件格式
    private String dataSource;          // 数据来源
    private String spacialScale;        // 空间范围
    private String timeScale;           // 时间范围
    private String spaceResolution;     // 空间分辨率
    private String timeResolution;      // 时间分辨率

    // 用于非叶子节点的构造方法（只包含名称和子目录）
    public DirItem(String name, List<DirItem> children) {
        this.name = name;
        this.children = children;
        // 其他参数默认null
        this.number = null;
        this.memorySize = null;
        this.measured = null;
        this.fileType = null;
        this.dataSource = null;
        this.spacialScale = null;
        this.timeScale = null;
        this.spaceResolution = null;
        this.timeResolution = null;
    }

    // 用于叶子节点的构造方法（包含所有参数）
    public DirItem(String name, List<DirItem> children, Integer number,
                   String memorySize, Boolean measured,Integer totalDada,String fileType,
                   String dataSource, String spacialScale, String timeScale,
                   String spaceResolution, String timeResolution) {
        this.name = name;
        this.children = children;
        this.number = number;
        this.memorySize = memorySize;
        this.measured = measured;
        this.totalDada = totalDada;
        this.fileType = fileType;
        this.dataSource = dataSource;
        this.spacialScale = spacialScale;
        this.timeScale = timeScale;
        this.spaceResolution = spaceResolution;
        this.timeResolution = timeResolution;
    }
}